home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Reference Guide / C-C++ Interactive Reference Guide.iso / c_ref / csource4 / 205_01 / expose.c < prev    next >
Text File  |  1979-12-31  |  768b  |  31 lines

  1. static char *progid = { "Expose v1.1 by Michael Yokoyama" };
  2.  
  3. /*  EXPOSE.C  This command exposes messages in executable files
  4. */
  5.  
  6. #include <stdio.h>
  7. #include <ctype.h>
  8.  
  9. main(argc,argv)
  10. int argc;            /* Number of command line words      */
  11. char *argv[];            /* Pointers to command line words */
  12. {
  13.     int c;
  14.     FILE *in;        /* File    used for input          */
  15.  
  16.     if (argc != 2) {    /* Check if enough arguments      */
  17.         fprintf(stderr,"Usage:    expose filename\n");
  18.         exit(1);
  19.     }
  20.  
  21.     if ((in = fopen(argv[1],"r")) == NULL) {
  22.         fprintf(stderr,"expose:  Can't open %s\n",argv[1]);    
  23.         exit(2);
  24.     }
  25.  
  26.     while ((c = getc(in)) != EOF)
  27.         if (isprint(c))
  28.             putchar(c);
  29.     fclose(in);
  30. }
  31.